function validate_1()
{
  // oUname is Object of <form>
  var oUname = document.register.uname;
  // checking attributes of input field
  alert("Name is "+oUname.name);
  alert("Id is "+oUname.id);
  alert("Type is "+oUname.type);
  alert("Value is "+oUname.value);
}

// for name
function validate_2()
{
  var oUname = document.register.uname;
  if(oUname.value == ''){
    alert("Name should not be Empty");
    oUname.focus();
    return false;
  } else if(oUname.value.length < 6){
    alert("Name should not be less then 6 char");
    oUname.focus();
    oUname.select();
    return false;
  }
}

// for gender
function validate_3()
{
  var oGender = document.register.hiddenGender;
  alert(oGender.value)
  if(oGender.value == ''){
    alert("Please select Gender");
    oGender.focus();
    return false;
  }
}
// hobbies
function validate_4()
{
  var oHobbies = document.getElementsByName('hobbies[]');
  var checkBoxLength = (oHobbies.length);
  var count = 0;
  var minCheck = 2;
  for(var i=0 ;i<checkBoxLength ; i++) {
    if(oHobbies[i].checked == true) {
      count++;
    }
  }
  if( count < minCheck ){
    alert("Please check atleast "+minCheck+ " hobbies");
    return false;  
  }
}  

  
// country
function validate()
{
  var oCountry = document.getElementById('countryId');
  if(oCountry.value == ""){
    alert("Please select country");
    return false;
  }
}  





